package com.atguigu.day17.test07;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Random;
import java.util.TreeSet;

/**
 * @author fenge
 */
public class Test07 {
    public static void main(String[] args) {
        ArrayList<TreeSet> ans = new ArrayList<>();
        TreeSet<Integer> blue = new TreeSet<>();
        TreeSet<Integer> red = new TreeSet<>();
        ans.add(red);
        ans.add(blue);
        for (int i = 0; i < 6;) {
//            Random ran = new Random();
//            ran.nextInt((1)*33+1);
            int rand = (int) (Math.random() * 33) + 1;
            if (!red.contains(rand)) {
                red.add(rand);//0,50 50-0+1+0
                i++;
            }
//            red.add((int)(Math.random()*33)+1);
        }
        blue.add((int)(Math.random()*16)+1);
        Iterator iout = ans.iterator();
        Iterator iin = red.iterator();
        Iterator iin1 = blue.iterator();
        System.out.println("双色球所有号码:[");

        for (TreeSet an : ans) {
            for (Integer integer : red) {
                System.out.print(integer+",");

            }
            for (Integer integer : blue) {
                System.out.println(integer+"]");
            }
        }
        System.out.println("红色号码:");
        while (iin.hasNext()){
            System.out.println(iin.next()+",");
        }
        System.out.println("蓝色号码:");
        while (iin1.hasNext()){
            System.out.println(iin1.next()+",");
        }
    }
}
